package cn.xpg.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.xpg.dao.OutproductMapper;
import cn.xpg.entity.Outproduct;
import cn.xpg.service.OutproductService;

@Service("outproductService")
public class OutproductServiceImpl implements OutproductService {

	@Resource(name = "outproductMapper")
	private OutproductMapper outproductMapper;

	@Override
	public int addOutproduct(Outproduct outproduct) {
		// TODO Auto-generated method stub
		int count = outproductMapper.addOutproduct(outproduct);
		return count;
	}

	@Override
	public int deleteOutproduct(int outproduct_id) {
		// TODO Auto-generated method stub
		int count = outproductMapper.deleteOutproduct(outproduct_id);
		return count;
	}

	@Override
	public List<Outproduct> getOutproductList(String product_name, int currentPageNo, int pageSize) {
		// TODO Auto-generated method stub
		List<Outproduct> list = outproductMapper.getOutproductList(product_name, currentPageNo, pageSize);
		return list;
	}

	@Override
	public int getOutproductCount(String product_name) {
		// TODO Auto-generated method stub
		int count = Integer.valueOf(outproductMapper.getOutproductCount(product_name).toString());
		return count;
	}

	@Override
	public Outproduct getOutproductId(int outproduct_id) {
		// TODO Auto-generated method stub
		Outproduct outproduct = outproductMapper.getOutproductId(outproduct_id);
		return outproduct;
	}

	@Override
	public int updateOutproduct(Outproduct outproduct) {
		// TODO Auto-generated method stub
		int count = outproductMapper.updateOutproduct(outproduct);
		return count;
	}

}
